package thread.withjoin;

/**
 * Created by mHandler on 2018/6/2 0002.
 * Description:
 */
public class TestJoin extends Thread {
    @Override
    public void run() {

        try {
            int value = (int) (Math.random() * 5000);
            System.out.println(value);
            Thread.sleep(value);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        try {
            TestJoin join = new TestJoin();
            join.start();
            join.join();
            System.out.println("我应该是在子线程后面执行");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
